{include file="public/_head" /}
<!-- /Navbar -->
<!-- Main Container -->
<div class="main-container container-fluid">
    <!-- Page Container -->
    <div class="page-container">

        <!-- Page Sidebar -->
        {include file="public/_left" /}
        <!-- /Page Sidebar -->
        <!-- Page Content -->
        <div class="page-content">
            <!-- Page Breadcrumb -->
            <div class="page-breadcrumbs">
                <ul class="breadcrumb">
                    <li>
                        <i class="fa fa-home"></i>&nbsp;前台首页
                    </li>
                    <li><a href="{:url('admin/contact/all')}">门店联系</a></li>
                    <li>门店联系编辑</li>
                </ul>
            </div>
            <!-- /Page Breadcrumb -->
            <!-- Page Body -->
            <div class="page-body">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="widget radius-bordered">
                            <div class="widget-header bordered-bottom bordered-themeprimary">
                                <span class="widget-caption">门店联系编辑</span>
                            </div>
                            <div class="widget-body">
                                <form action="" class="form-horizontal">
                                    <input type="hidden" name="id" value="{$contactInfo.id}">
                                    <div class="form-group">
                                        <label for="address" class="control-label col-sm-2 no-padding-right">地址</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="address" value="{$contactInfo.address}" name="address" placeholder="地址" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="mailbox" class="control-label col-sm-2 no-padding-right">邮箱</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="mailbox" name="mailbox" value="{$contactInfo.mailbox}" placeholder="邮箱" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="tel" class="control-label col-sm-2 no-padding-right">电话</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="tel" name="tel" value="{$contactInfo.tel}" placeholder="电话" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="trans" class="control-label col-sm-2 no-padding-right">传真</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="trans" name="trans" value="{$contactInfo.trans}" placeholder="传真" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-offset-2 col-sm-6">
                                            <button type="submit" id="contactEdit" class="btn btn-primary">更新</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Page Body -->
        </div>
        <!-- /Page Content -->

    </div>
    <!-- /Page Container -->
    <!-- Main Container -->

</div>

{include file="public/_js" /}
<!--富文本编辑器-->
<script src="/Tp5/public/static/lib/ueditor/ueditor.config.js"></script>
<script src="/Tp5/public/static/lib/ueditor/ueditor.all.js"></script>
<script>
    $(function () {
        UE.getEditor('content');

        $('#contactEdit').click(function () {
            $.ajax({
                url:"{:url('admin/contact/edit')}",
                type:'post',
                data:$('form').serialize(),
                dataType:'json',
                success:function (data) {
                    if (data.code == 1){
                        layer.msg(data.msg,{
                            icon:6,
                            time:1200
                        },function () {
                            location.href = data.url;
                        });
                    }else {
                        layer.open({
                            title:'更新失败',
                            content:data.msg,
                            icon:5,
                            anim:6
                        });
                    }
                }
            });
            return false;
        });
    });
</script>